#include <bits/stdc++.h>
using namespace std;
const int maxn=500050;
int n,a[maxn];
int xl[maxn],len;
int res[maxn],len2;
bool f=0;
void calc()
{
	for (int i=1;i<=n;i++)
		if (res[i]!=res[2*n-i+1]) return;
	for (int i=1;i<=2*n;i++)
	{
		if (xl[i]==1) printf("L");
		else printf("R");
		f=1;
	}
}
void dfs(int l,int r)
{
	if (f) return;
	if (r==l)
	{
		res[++len2]=a[l];
		xl[++len]=1;
		calc();
		len2--,len--;
		return;
	}
	res[++len2]=a[l],xl[++len]=1,dfs(l+1,r),len2--,len--;
	res[++len2]=a[r],xl[++len]=2,dfs(l,r-1),len2--,len--;
}
int main()
{
	freopen("palin.in","r",stdin);
	freopen("palin.out","w",stdout);
	int T;scanf("%d",&T);
	while (T--)
	{
		len2=len=0;
		scanf("%d",&n);
		f=0;
		for (int i=1;i<=2*n;i++) scanf("%d",&a[i]);
		dfs(1,n*2);
		if (!f) printf("-1\n");
		else printf("\n");
	}
	fclose(stdin);
	fclose(stdout);
}
